package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 受益报表类型
 * @Date : 2021/10/21 14:25
 * @Modified by : zjf
 */
public enum IncomeReportType {
    DAILY("daily", "日报表"),
    MONTH_AND_YEAR("monthAndYear","月年报表"),
    ;

    private String code;
    private String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    IncomeReportType(String code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(String code){
        for(IncomeReportType type: IncomeReportType.values()){
            if(type.getCode().equals(code)){
                return type.getDesc();
            }
        }
        return null;
    }

    public static String fromDesc(String desc){
        for(IncomeReportType type: IncomeReportType.values()){
            if(type.getDesc().equals(desc)){
                return type.getCode();
            }
        }
        return null;
    }
}
